<template>
	<div>
		<uni-section title="审批中心"  type="line" padding>
			<uni-grid :column="4" :highlight="true" @change="change">
				<uni-grid-item v-for="(item, index) in data" :index="index" :key="index">
					<view class="grid-item-box">
						<!-- <uni-icons type="person-filled" size="30"></uni-icons> -->
						<image class="icon_img" :src="$mapIconURL(item.icon)"></image>

						<text class="text">{{item.name}}</text>
					</view>
				</uni-grid-item>
			</uni-grid>
		</uni-section>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				data: []
			}
		},
		onLoad(options) {
			console.log('options', options)
			if (options.childrenIndex) {
				const {childrenIndex}=options
				console.log('childrenIndex',childrenIndex)
			this.data = this.$store.state.user.menus[childrenIndex].children
			}
		},
		methods: {
			// 宫格点击
			change(e){
				const {index} = e.detail
				console.log('宫格点击',this.data[index].path)
				uni.navigateTo({
					url:`${this.data[index].uniappPath}`
				})
				
			}
		} 
	}
</script>

<style lang="scss" scoped>
</style>